package com.dangdang.interview.sort;

import java.util.Comparator;

public class StudentComparable implements Comparator<Student> {

	@Override
	public int compare(Student o1, Student o2) {
		if(o1.getChinese()==o2.getChinese()) {
			if(o1.getMath()==o2.getMath()) {
				return o1.getEnglish()-o2.getEnglish();
			}
			return o1.getMath()-o2.getMath();
		}
		return o1.getChinese()-o2.getChinese();
	}
}
